import request from "./request";
import {User} from '@/typings/user'

export const Login = (data:any) => {
  return request({
    url: "/Login/UserLogin", //url =  request.baseURL + "/Login/UserLogin" =
    method: "post",
    data
  });
};


export const GetUserList = () =>{
  return request({
    url: "/Login/GetUserList",
    method: "get",
  });
}

/**删除用户 */
export const DelUser = (id:number|null) =>{
  return request({
    url: "/Login/DelUser",
    method: "get",
    params: {
      id: id
    }
  });
}


/**新增用户 */
export const AddUser = (data:User) =>{
  return request({
    url: "/Login/AddUser",
    method: "post",
    data
  });
}


/**更新用户 */
export const UpdateUser = (data:User) =>{
  return request({
    url: "/Login/UpdateUser",
    method: "post",
    data
  });
}